home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 April / Macworld (1999-04).dmg / Serious Software / GrooveMaker demo / GrooveMaker Demo / Media / MenuSong.dxr / 00024.ls < prev    next >
Encoding:
Text File  |  1998-07-27  |  2.3 KB  |  65 lines

  1. on prepare
  2.   global gSong, gPath, gBpmSong, gGrooveSel, scaleList, audioList, keyNoteList, keyList, gInfo
  3.   stop(member "preview")
  4.   IKRealtimeFreq(22050)
  5.   set gBpmSong to integer(field "fieldBpm")
  6.   set scaleList to []
  7.   set linea to chars(line the number of lines in gInfo - 3 of gInfo, 3, length(line the number of lines in gInfo - 3 of gInfo))
  8.   repeat with i = 1 to the number of words in linea
  9.     append(scaleList, word i of linea)
  10.   end repeat
  11.   sort(scaleList)
  12.   if getPos(scaleList, "A") then
  13.     deleteAt(scaleList, getPos(scaleList, "A"))
  14.     append(scaleList, "A")
  15.   end if
  16.   if getPos(scaleList, "Ad") then
  17.     deleteAt(scaleList, getPos(scaleList, "Ad"))
  18.     append(scaleList, "Ad")
  19.   end if
  20.   if getPos(scaleList, "B") then
  21.     deleteAt(scaleList, getPos(scaleList, "B"))
  22.     append(scaleList, "B")
  23.   end if
  24.   put EMPTY into field "song"
  25.   repeat with i = 1 to the number of lines in gInfo - 12
  26.     put line i of gInfo into line i of field "song"
  27.   end repeat
  28.   put EMPTY into field "compSong"
  29.   repeat with i = 1 to 8
  30.     put line the number of lines in gInfo - 12 + i of gInfo into line i of field "compSong"
  31.   end repeat
  32.   IKResetVTracks()
  33.   repeat with i = 1 to the lineCount of member "song"
  34.     set nomeFile to word 1 of line i of field "song"
  35.     set rep to integer(word 6 of line i of field "song")
  36.     IKAddVTrack(gPath & "song:song22:" & gSong & ":" & nomeFile, rep, 0)
  37.   end repeat
  38.   IKSetSongBPM(gBpmSong)
  39.   IKBegin("IKTRACK.X32 CTL3DV2.DLL")
  40.   IKMasterVolume(integer(field "fieldMasterVol"))
  41.   IKMixBPM(gBpmSong)
  42.   if field "fieldSynth" <> EMPTY then
  43.     IKSetSynth(gPath & "synth:synth22:" & field "fieldSynth" & ":")
  44.   end if
  45.   put EMPTY into field "fieldAudio"
  46.   set audioList to []
  47.   repeat with i = 1 to the lineCount of member "song"
  48.     put "√†√† " & word 1 of line i of field "song" & RETURN after field "fieldAudio"
  49.     append(audioList, word 1 of line i of field "song")
  50.   end repeat
  51.   delete char -30000 of field "fieldAudio"
  52.   scrollByPage(member "fieldAudio", -((the lineCount of member "fieldAudio" / 20) + 1))
  53.   set the textFont of member "fieldAudio" to "GMfont"
  54.   set the foreColor of member "fieldAudio" to 54
  55.   set gGrooveSel to 0
  56.   set keyNoteList to [:]
  57.   set k to 0
  58.   repeat with i = 1 to 3
  59.     repeat with j = 1 to count(scaleList)
  60.       set k to k + 1
  61.       addProp(keyNoteList, getAt(keyList, k), getAt(scaleList, j))
  62.     end repeat
  63.   end repeat
  64. end
  65.